<style>
#tintrongloai  #path{
	color:#FFFFFF;
	padding-top:13px;
	padding-bottom:5px;
	font-weight:bold;
	background-image: url(image/label_long.png);
	background-repeat: no-repeat;
	height: 33px;
	width: 700px;
	padding-left: 10px;
	text-align: left;
}
#tintrongloai #path a{
	text-decoration:none;
	color:#FFFFFF;
}
#tintrongloai #path a:hover{
	text-decoration:none;
	color:#FFFFFF;
	border-bottom-width: 1px;
	border-bottom-style: dotted;
	border-bottom-color: #FFFFFF;
}
#tintrongloai .row_tin {
	padding-right:5px;
	min-height:180px;
	padding-top: 5px;
	padding-bottom: 5px;
	padding-left: 10px;
	height: 525px;
	width: 334px;
	float: left;
	border-right-width: 1px;
	border-right-style: dashed;
	border-right-color: #CC3300;
}
.img  {
	margin-right:5px;
	width:330px;
	height:230px
}
#tintrongloai .xemtiep {
	text-align: right;
	background-image: url(image/label_chung.png);
	background-repeat: no-repeat;
	height: 52px;
	width: 100%;
}
#tintrongloai .tieude{
	font-weight:bolder;
	margin-top:5px;
	margin-bottom:5px;
	background-color: #B1FEA9;
	display: block;
	text-transform: uppercase;
	color: #004000;
	height: 38px;
	border-top-width: 1px;
	border-bottom-width: 1px;
	border-top-style: dotted;
	border-bottom-style: dotted;
	border-top-color: #008000;
	border-bottom-color: #008000;
}
.tomtat  {
	text-align:left;
	margin-top:5px;
	margin-bottom:5px;
}
#tintrongloai .ngay{ margin-top:5px; margin-bottom:5px; color:#003333; font-style:italic}

#tintrongloai #thanhphantrang {
	margin:1px;
}
#tintrongloai #thanhphantrang a  {
	background-color:#004000;
	color:#80FF80;
	padding-left:8px;
	padding-right:8px;
	padding-top:2px;
	padding-bottom:2px;
	margin-left:2px;
	margin-right:2px;
	text-decoration:none;
}
#tintrongloai #thanhphantrang a:hover{
	color:#008000;
	text-decoration:underline;
	background-color:#80FF80
}  
#ngay {
	display: none;
}
#chung {
	height: 49px;
	width: 180px;
}


#chung .dathang {
	float: right;
}
#chung .chitiet {
	float: left;
}
#tintrongloai #thanhphantrang span  {
	background-color:#FFFFFF;
	color:#FF0000;
	padding-left:3px;
	padding-right:3px;
	padding-top:2px;
	padding-bottom:2px;
	font-weight:bold;
	margin: 0px;
}
#giohang_tomtat {
	height: 63px;
	text-align: left;
	float: left;
	width: 700px;
	background-image: url(image/label_ticket.png);
	background-repeat: no-repeat;
}
#giohang {
	display: none;
}
#sub_giohang {
	float: right;
	height: 24px;
	width: 600px;
	padding-top: 15px;
}
#giohang_tomtat  #test {
	height: 47px;
	text-align: left;
	float: left;
	width: 600px;
	padding-top: 15px;
	padding-left: 100px;
	font-size: large;
}
#red {
	font-weight: bolder;
	color: #FF0000;
	background-color: #FF9797;
	height: 20px;
	width: 20px;
	border: 1px dotted #FF0000;
	text-align: center;
	margin-right: 5px;
	margin-left: 5px;
	padding-right: 2px;
	padding-left: 5px;
}
#chitiet2  a {
	font-size: small;
	color: #FF0000;
	text-decoration: none;
}
#chitiet2  a:hover {
	font-size: small;
	color: #FF0000;
	font-weight: bold;
}
.an {
	display: none;
}
.hien {
}
.scroll-to-top-button{
	width: 32px;
	height: 32px;
	color: #fff;
	font-family: verdana;
	border-radius: 5px;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	-o-border-radius: 5px;
	cursor: pointer;
	padding: 15px;
	margin: 20px;
	background-color: #666;
	background-image: url(image/ScrollToTop.png);
	background-repeat: no-repeat;
	background-position: center center;
}
</style>
<!-----------------------------------CART----------------------------------->
<script type="text/javascript" src="Scripts/jquery-1.4.3.min.js"></script>
<script>
// cart
var url="cart.php";

$(document).ready(function() {	

if ($("#tsl").text()=="") $("#giohang_tomtat").html("");
else 
//$("#giohang_tomtat").html("Bạn đã đặt "+ $("#tsl").text() +" tour." );
$("#giohang_tomtat").html("<span id='test'> Bạn đã đặt <span id='red'>"+ $("#tsl").text() +"</span> tour. " + "<span id='chitiet2'><a href='index.php?p=tourcart'> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<< Xem chi tiết >></a></span>" + "</span>");

	$(".dathang").click(function(){
		idTin = $(this).attr("idTin");	
		data = 'action=add&idTin='+idTin;
		$("#giohang").load(url,data, xuly);	
		$("#giohang_tomtat").html("Bạn đã đặt "+ $("#tsl").text() +" tour. " );
    })
});

$(document).ready(function() {
//những việc sẽ làm khi nhắp nút cập nhật số lượng
	$(".capnhatsoluong").click(function(){
	var idTin = $(this).attr("idTin");
	var soluong = $(this).parent().find('#soluong').val();
	var data = 'action=update&idTin='+idTin +'&soluong='+soluong;
	$("#giohang").load(url,data, xuly);		
	})
});

$(document).ready(function() {
//những việc sẽ làm khi nhắp nút remove sp
	$(".removesp").click(function(){
		var idTin = $(this).attr("idTin");
		var data = 'action=remove&idTin='+idTin;
		$("#giohang").load(url,data, xuly);	
	})
});

$(document).ready(function() {
//những việc sẽ làm khi nhắp nút xoá hết
	$("#xoahet").click(function(){
		var data = 'action=removeAll';
		$("#giohang").load(url,data, xuly);
	})
});

function xuly(responseText, textStatus, XMLHttpRequest) {
	
if (responseText=="") $("#giohang_tomtat").html("");
else 
//$("#giohang_tomtat").html("Bạn đã đặt "+ $("#tsl").text() +" tour. Tổng tiền là " + $("#tt").text() );
$("#giohang_tomtat").html("<span id='test'> Bạn đã đặt <span id='red'>"+ $("#tsl").text() +"</span> tour. " + "<span id='chitiet2'><a href='index.php?p=tourcart'> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<< Xem chi tiết >></a></span>" + "</span>");


//những việc sẽ làm khi nhắp nút cập nhật số lượng
	$(".capnhatsoluong").click(function(){
	var idTin = $(this).attr("idTin");
	var soluong = $(this).parent().find('#soluong').val();
	var data = 'action=update'+ '&idTin='+idTin +'&soluong='+soluong;
	$("#giohang").load(url,data, xuly);		
	})

//những việc sẽ làm khi nhắp nút remove sp
	$(".removesp").click(function(){
		var idTin = $(this).attr("idTin");
		var data = 'action=remove'+ '&idTin='+idTin;
		$("#giohang").load(url,data, xuly);	
	})

//những việc sẽ làm khi nhắp nút xoá hết
	$("#xoahet").click(function(){
		var data = 'action=removeAll';
		$("#giohang").load(url,data, xuly);
	})
}


</script>
<!-----------------------------------CART----------------------------------->
<!-----------------------------------SCROLL TO TOP----------------------------------->
<script type="text/javascript" src="Scripts/ScrollToTop/autoScroll.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$.autoScroll({
		scrollDuration: 2000,
		showDuration: 600,
		hideDuration: 300
	});
});​
</script>
<!-----------------------------------SCROLL TO TOP----------------------------------->
<?php 
require_once('classTin.php'); 
$t = new tin;
session_start();
$p = $_GET['p'];
$tsl2=$_SESSION['tsl2'];
$tt2=$_SESSION['tt2'];
?>
<?php
//Tiếp nhận tham số 
$idLT=$_GET['idLT']; settype($idLT, "int");  
//Các biến dùng để phân trang
$pageSize = 6; 
$pageNum = 1;
if (isset($_GET['pageNum'])==true) $pageNum = $_GET['pageNum'];
settype($pageNum,"int");
if ($pageNum<=0) $pageNum=1; 

//Lấy 1 trang tin
$tin = $t->TinTrongLoai($idLT, $lang, $pageNum, $pageSize);	

//Lấy tên loại tin, tên thể loại 
$loaitin = $t->ChiTietLoaiTin($idLT);
$row_loaitin = mysql_fetch_row($loaitin);	

//Đếm số tin
$totalRows = $t->DemSoTinTrong1Loai(-1,$idLT,$lang,1);
?>

<div id="tintrongloai">
<div id="path"> <a href="index.php">Home</a> &nbsp; <img src="images/icon_arrow.png" alt="&gt;"> <a href="index.php?p=con&idTL=<?=$row_loaitin[4]?>"><?=$row_loaitin[3];?></a>&nbsp; <img src="images/icon_arrow.png" alt="&gt;"> <?=$row_loaitin[1];?> </div>

<div id="thanhphantrang" align="right"> 
<?php echo $t->pagesList($totalRows,$pageNum, $pageSize, 5) ; ?>  
</div>

<?php if(($idLT==104) || ($idLT==105) || ($idLT==106) || ($idLT==99) || ($idLT==100) || ($idLT==101)) { ?>
	<div id="giohang_tomtat" class="an">
        <div id="sub_giohang">
        Bạn chưa đặt tour nào.
        </div>
        
    </div>
<?php } else { ?>
	<div id="giohang_tomtat" class="hien">
        <div id="sub_giohang">
        Bạn chưa đặt tour nào.
        </div>
        
    </div>
<?php } ?>

	


<?php while ($row_tin=mysql_fetch_assoc($tin)) {?>
<div class="row_tin">
<p class="tieude"> <?=$row_tin['TieuDe'];?> </p>
<p class="ngay">
<p><a href="index.php?p=details&idTin=<?=$row_tin['idTin']?>"><img class="img" src="<?=$row_tin['urlHinh'];?>" align="left"></a></p>
<p><span id="ngay">Ngày đăng: <?=date('d/m/Y',strtotime($row_tin['Ngay']));?>. </span>
Số lần xem: <?=$row_tin['SoLanXem'];?> </p>
<div class="tomtat"> <?=$row_tin['TomTat'];?> </div>
<div class="xemtiep">
    <div id="chung">
    <?php if(($idLT==104) || ($idLT==105) || ($idLT==106) || ($idLT==99) || ($idLT==100) || ($idLT==101)) { ?>
    	<a href="index.php?p=details&idTin=<?=$row_tin['idTin']?>"><img class="chitiet" src="image/label_details.png" /></a>
    <?php } else { ?>
    
        <a href="index.php?p=details&idTin=<?=$row_tin['idTin']?>"><img class="chitiet" src="image/label_xemchitiet.png" /></a>
        <a href="#giohang_tomtat"><img class="dathang" src="image/label_dattour.png" idTin="<?=$row_tin['idTin']?>" /></a> 
    <?php } ?>
    </div>

</div>
</div>
<?php } ?>

<div id="thanhphantrang" align="right"> 
<?php echo $t->pagesList($totalRows,$pageNum, $pageSize, 5) ; ?>  
</div>
<div id="giohang"><?php include "hiengiohang_update.php"; ?></div>
</div> <!--div tintrongloai -->